package com.shakev.coupon.data.mysql.controller;


import com.shakev.coupon.business.util.rest.RestResponse;
import com.shakev.coupon.data.mysql.entity.Feedback;
import com.shakev.coupon.data.mysql.service.IFeedbackService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author lws
 * @since 2019-06-13
 */
@RestController
public class FeedbackController {

    @Resource
    IFeedbackService feedbackService;

    @RequestMapping("/feedback/add")
    public RestResponse add(@RequestBody Feedback feedback){
        Feedback param = new Feedback();
        param.setFeedbackContent(feedback.getFeedbackContent());
        param.setUserId("1");
        boolean res = feedbackService.save(param);
        return RestResponse.success(res);
    }
}
